<?php
function baseUrl() {
	$proto = explode("/", $_SERVER['SERVER_PROTOCOL']);
	$proto = strtolower($proto[0]);
	return $proto.'://'.$_SERVER['HTTP_HOST'];
}
    
function url($module, $action, $params = array()) {
    $url = baseUrl().'/?mod='.$module.'&act='.$action;
    if(!empty($params)) {
        foreach($params as $key=>$value) {
            $url.='&'.$key.'='.$value;
        }
    }
    return $url;
}

function redirect($url){
    header("location: {$url}");
    exit(0);
}
?>